// import { adminRequest } from '@/utils/request'
import {
  axios
} from '@/utils/request'
import {
  getAction,
  deleteAction,
  putAction,
  postAction,
  httpAction,
  postFormData
} from '@/api/manage'
const gateway = '/gateway/api'
const gateapi = '/api/gateway'
const goodCard = '/gateway/api/admin/goods/card'
const api = {
  list: goodCard + '/list',
  create: goodCard + '/create',
  detail: goodCard + '/detail',
  updateStatus: goodCard + '/updateStatus',
  cardList: goodCard + '/cardlist'

}
export default api

// 查询商品列表
export function goodsCardList (parameter) {
  return axios({
    url: api.list,
    method: 'post',
    data: parameter
  })
}
// 商品创建
export function goodsCreate (parameter) {
  return axios({
    url: api.create,
    method: 'post',
    data: parameter
  })
}
// 查询商品详情
export function goodsDetail (parameter) {
  return axios({
    url: api.detail,
    method: 'post',
    data: parameter
  })
}
// 商品上下架
export function updateStatus (parameter) {
  return axios({
    url: api.updateStatus,
    method: 'post',
    data: parameter
  })
}
// 查询会员卡列表
export function cardList (parameter) {
  return axios({
    url: api.cardList,
    method: 'post',
    data: parameter
  })
}
// 获取品牌卡
export const brandCondition = params => postAction(gateway + '/admin/goods/card/brandCondition', params)
// 获取该品牌的 品牌卡等级
export const cardTypeCondition = params => postFormData(gateway + '/admin/goods/card/cardTypeCondition', params)

// 查询业务标签列表
export const queryGoods = params => postAction(gateapi + '/jnby-product-center/product/biztag/api/queryGoods', params)
// 创建修改业务标签
export const createOrUpdate = params => postAction(gateapi + '/jnby-product-center/product/biztag/api/createOrUpdate', params)
// 取消上架
export const modifyPost = params => postAction(gateapi + '/jnby-product-center/product/biztag/api/modifyStatus', params)

export const cardTypeAllCondition = params => postAction('/gateway/api/admin/goods/card/cardTypeAllCondition', params) // 获取该品牌的 品牌卡等级